import requests
from bs4 import BeautifulSoup

def spider():
    url = 'http://f10.emoney.cn/f10/ggda/1002049'
    res = requests.get(url)
    # print(res.text)
    soup = BeautifulSoup(res.text,"html.parser")
    # table = soup.select('body > div:nth-child(15) > div > table')
    names = soup.select('body > div:nth-child(15) > div > table > tbody > tr > td:nth-child(1)')
    sexs = soup.select('body > div:nth-child(15) > div > table > tbody > tr > td:nth-child(2)')
    ages = soup.select('body > div:nth-child(15) > div > table > tbody > tr > td:nth-child(3)')
    # print(table)
    #
    for name, sex, age in zip(names, sexs, ages):
        data = {
            'name': name.getText(),
            'sex': sex.getText(),
            'age': age.getText()
        }
        print(data)
if __name__ == '__main__':
    spider()
